1. Field of the Invention
Apparatuses and methods consistent with exemplary embodiments relate to a geomagnetic sensor which measures the magnitude and direction of the Earth's magnetic field, and more specifically, to a geomagnetic sensor calibration apparatus and method which correct errors of geomagnetic sensors.
2. Description of the Related Art
Various types of electronic devices including devices having global positioning system (GPS) functions and compass functions have been developed and supplied with the development of electronic technologies. In order to perform these functions, a process of calculating azimuth is required. Gyro sensors or geomagnetic sensors are widely used to calculate azimuth. For example, gyroscopes and geomagnetic sensors are mounted on electronic devices, such as smart phones or tablet personal computers (PCs) and perform various services or functions including sensing user movements and estimating direction of devices.
A gyroscope sensor calculates rotating angular velocity by calculating Coriolis force. When a gyroscope is used, velocity is calculated by measuring and integrating accelerations, and displacement information is obtained by double integrating the calculated velocity.
A geomagnetic sensor measures the geomagnetic field with a method of measuring voltage values induced by the geomagnetic field by using a fluxgate of other device. The geomagnetic sensor may be implemented with two axes or three axes. Because output values calculated from each axis of the geomagnetic sensor vary according to the magnitude of surrounding geomagnetic fields, normalization, in which output values of the geomagnetic sensor are mapped within a preset range, for example, from −1 to 1, may be performed. Normalization is performed by using normalizing factors, such as scale values or offset values. To calculate normalizing factors, output values are calculated while rotating the geomagnetic sensor several times, and maximum and minimum values are detected among the output values. Values normalized by using normalizing factors are utilized in calibrating azimuth.
However, offset values among normalizing factors are often distorted due to influences of surrounding environment factors which affect magnetism. FIG. 1 is an illustration which simplifies and expresses magnetic distortion on dimensional coordinates.
There are soft iron effects and hard iron effects for magnetic distortion which influence the geomagnetic sensor. Effects by soft iron change the scale of sensor values and effects by hard iron influence the offset of sensor values. Because effects by soft iron are usually minimal, to calibrate errors of the geomagnetic sensor effects by hard iron are discussed.
For example, when the geomagnetic sensor is mounted within mobile electronic devices, such as cellular phones, offset values may be changed when substituting a battery or closing and opening LCD folder. Offset values may also be changed when turbulent material, such as objects with strong magnetic properties or steel structures are placed near the geomagnetic sensor. When normalization is performed by using distorted offset values, normalized values are distorted. Therefore, finally calculated azimuth includes errors.
FIG. 2 is a diagram which illustrates effects by hard iron on three-dimensional coordinates of X, Y, and Z.
Korean Patent No. 10-0831373 discloses that a geomagnetic sensor is calibrated by using offset values, average values, and standard deviation values so as to account for errors caused by effects of hard iron in sensed values of the geomagnetic sensor.
According to KR 10-0831373, a three-axis geomagnetic sensor calculates output values corresponding to surrounding magnetics by using a fluxgate of X, Y, and Z axes that are orthogonally crossed. The output values from the three-axis geomagnetic sensor are normalized by mapping each of output values in the fluxgate of X, Y, and Z axes within a preset range, for example, from −1 to 1. Offset values and scale values used in normalization are previously established and stored in an internal memory.
Distance (re) between output values (X, Y, Z) of the three-axis geomagnetic sensor and preset offset values (X0P, Y0P, Z0P) can be expressed with the following mathematical formula:rp=√{square root over ((X−X0p)2+(Y−Y0p)2+(Z−Z0p)2)}  [Formula 1]
According to Formula 1, when distance (rp) is greater than allowable range (α), it is determined that the geomagnetic values are distorted and calibration is performed. The above offset values are central points of a sphere which indicate critical error values calculated statistically. The allowable range can be established with various values, such as 1 or 1±0.1 according to the area in which the electronic device having the three-axis geomagnetic sensor is used or according to the use objectives of electronic devices.
When distortion is determined to occur, sampling sensed geomagnetic values is performed to calibrate errors. Sampling is randomly performed whenever the geomagnetic sensor device moves within preset time. KR 10-0831373 suggests a method of keeping a distance between respective sampled values to be more than a preset distance. In other words, KR10-0831373 selects sampled values only out of critical distance.
After sampling, the mean (mean(rp)) and standard deviation (std(rp)) of distances (rp) between output values (X, Y, Z) to be sampled in the geomagnetic sensor and the above offset values are calculated. If any one of the mean (mean(rp)) and the standard deviation (std(rp)) is greater than a preset value, it is determined that distortion has occurred.
In order to calibrate the three-axis geomagnetic sensor, a three-dimensional sphere which has central points (X0, Y0, Z0) and radius (r) can be modeled according to the following mathematical formula:(X−X0)2+(Y−Y0)2+(Z−Z0)2r2  [Formula 2]
The least square method is used to calculate central points (X0, Y0, Z0) from values of the three-axis geomagnetic sensor. Preset offset values (X0P, Y0P, Z0P) are established as initial values of central points (X0, Y0, Z0), and radius (r) is a constant value established as the radius of a magnetic sphere based on preset offset values (X0, Y0, Z0). The central points are estimated with a Gauss-Newton algorithm.
However, the method of calibrating a geomagnetic sensor proposed by KR 10-0831373 lacks preciseness in estimating central points because the initial values established based on specific conditions, and used in the calibration calculations, are fixed. Therefore, a method of calibrating a geomagnetic sensor more precisely is necessary.